<!--
 * @file: 综合示例
 * @author: xiaoyu
 * @Date: 2021-07-08 10:17:16
-->
<template>
  <div>
    home{{ filterList }}
    <input type="text" v-model="filterStr" />
    <a-input type="text" v-model:value="filterStr"></a-input>
    <a-button type="primary">Primary</a-button>

    <appBaseTable :columns="demoConfig.tableColumns"></appBaseTable>
  </div>
</template>

<script setup lang="ts">
import { ref, computed, onMounted, reactive } from 'vue'
import { useStore } from 'vuex'
import httpService from '../../utils/axios/http'
import filterAction from '../../common/demo/index'
import appBaseTable from '../../components/demo/appBaseTable.vue'
import config from './config.demo'

const count = ref(1)

const store = useStore()

const demoConfig = reactive(config)

const { filterStr, filterList } = filterAction()

store.dispatch('setUserToken', '测试store')

const name = computed(() => store.getters['demo/getName'])

setTimeout(() => {
  store.dispatch('demo/setName', { name: '李四' })
}, 3000)

onMounted(() => {
  console.log(import.meta.env)
  httpService
    .get('/users/XPoet', { name: 'zhangsan' })
    .then((res) => {
      console.log('res: ', res)
    })
    .catch((err) => {
      console.log('err: ', err)
    })
})
</script>

<style></style>
